{include file="common/header"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <form action="" class="layui-form">
                            <div class="layui-row layui-col-space10">
                              <div class="layui-col-md2 layui-col-xs4">
                                <input type="text" name="" id="username" lay-verify="required" placeholder="请输入账号" class="layui-input">
                              </div>
                              <div class="layui-col-md2 layui-col-xs4">
                                <input type="text" name="" id="url" lay-verify="required" placeholder="请输入URI地址" autocomplete="off" class="layui-input">
                              </div>
                              <div class="layui-col-md2 layui-col-xs4">
                                <input type="text" name="" id="sstarttime" lay-verify="required" placeholder="开始时间" autocomplete="off" class="layui-input">
                              </div>
                              <div class="layui-col-md2 layui-col-xs4">
                                <input type="text" name="" id="sendtime" lay-verify="required" placeholder="结束时间" autocomplete="off" autocomplete="off" class="layui-input">
                              </div>
                              <div class="layui-col-md2 layui-col-xs4">
                                <input type="button" id="searchBtn" name="submit" class="layui-btn" value="搜索">
                              </div>
                            </div>
                        </form>
                    </div>
                    <div class="layui-row">
                        <table class="layui-table" id="list" lay-filter="list"></table>
                    </div>
                </div>

            </div>
        </div>        
    </div>
</div>
<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-group">
        <a data-href="{:url('del')}"  class="layui-btn layui-btn-sm layui-btn-danger" id="delAll">{:lang('delete checked')}</a>
    </div>

</script>

<script type="text/html" id="action">
<div class="layui-btn-group">
    <a class="layui-btn layui-btn-xs" href="javascript:;" onclick="xadmin.open('查看参数','{:url('logform')}?id={{d.id}}');">查看参数</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-href="{:url('del')}?id={{d.id}}">{:lang('del')}</a>
</div>
</script>

{include file="common/footer"/}
<script>
var table;
var searchObj = {};
searchObj['username'] = '';
searchObj['url'] = '';
searchObj['sstarttime'] = '';
searchObj['sendtime'] = '';
layui.use(['table'], function () {
    var table = layui.table;
    table.render({
        elem: '#list',
        url: '{:url("index")}',
        method: 'post',
        where:searchObj,
        toolbar: '#toolbarDemo',
        defaultToolbar: [],
        id:'list',
        cols: [[
            {checkbox: true, fixed: 'left'},
            {field: 'id', title: 'ID', width: 80, sort: true},
            {field: 'username', title: '账号', width: 150},
            {field: 'host', title: '地址'},
            {field: 'ip', title: 'IP'},
            {field: 'url', title: 'URI'},
            {field: 'create_time', title: '时间'},
            {title:'操作', toolbar: '#action',align:"center"}
        ]],
        limits: [10, 15, 20, 25, 50, 100],
        limit: 15,
        page: true,
   });
    // 搜索
    $('#searchBtn').click(function(){
        searchObj['username'] = $('#username').val();
        searchObj['url'] = $('#url').val();
        searchObj['sstarttime'] = $('#sstarttime').val();
        searchObj['sendtime'] = $('#sendtime').val();
        table.reload('tableReload',{where:searchObj});
    }) 
});


</script>